package calao;

import java.util.HashMap;
import java.util.HashSet;

public class Application 
{
	
	static class Map extends HashMap<String,Application> { } 
	static class NameSet extends HashSet<String> { } 
	
	final String name;
	final String[] dependencies;
	
	protected Application(String name)
	{
		this(name, null);
	}
	
	protected Application(String name, String[] dependencies)
	{
		this.name = name;
		this.dependencies = dependencies!=null? dependencies : new String[0];
	}

	public void onStart(Server server) { }
	
	public void onStop(Server server) { }

	public void onOpen(Workspace ws) { }
	
	public void onClose(Workspace ws) { }
	
	public void onCreate(Membership membership) { }
	
	public void onDelete(Membership membership) { }
	
	public String getName()
	{
		return name;
	}
	
	public final String[] getDependencies()
	{
		return dependencies;
	}
	
	public Service newService(Class serviceFace)
	{
		return null;
	}
			
}
